﻿using System;

namespace Hydrogen.MathExt.Expression.Functions.Operators
{
    /// <summary>
    /// 除法
    /// </summary>
    internal class OperatorDivide : OperatorBinaryBase
    {
        public override int Precedence => 2;
        public override double Evaluate(double left, double right)
        {
            if (right == 0) throw new DivideByZeroException($"除零错误. left={left}");
            return left / right;
        }
    }
}
